<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/jsp/base/taglibs.jsp"%>
<%@include file="/WEB-INF/jsp/base/head.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>增加餐厅</title>
</head>
<body>
	<div class="center_main"></div>
	<div id="page-top">
		<span>增加餐厅</span> <b></b><i></i>
	</div>

	<div id="page">

		<s:form action="restaurantAction!restaurantAdd.do"
			namespace="/restaurant" name="form1" method="post"
			enctype="multipart/form-data">
			<div class="edit-wapper">
				<label class="lab">餐厅类型：</label>
				<s:select list="codes" id="codes" listKey="code" listValue="text"
					name="restaurantBizBean.restaurantType" headerKey=""></s:select>
			</div>
			<div class="edit-wapper">
				<label class="lab">名称：</label> <input type="text"
					name="restaurantBizBean.name" id="name" class="inputText"
					maxlength="30" style="width: 450px" />
			</div>
			<div class="edit-wapper">
				<label class="lab">地址：</label> <input type="text"
					name="restaurantBizBean.address" id="address" class="inputText"
					maxlength="30" style="width: 450px" /> <label class="error">*&nbsp;&nbsp;<s:property
						value="%{errors['address'][0]}" /></label>
			</div>
			<div class="edit-wapper">
				<label class="lab">经度：</label> <input type="text"
					name="restaurantBizBean.longitude" id="codeName" class="inputText"
					maxlength="30" style="width: 450px" /> <label class="error">*&nbsp;&nbsp;<s:property
						value="%{errors['longitude'][0]}" /></label>
			</div>

			<div class="edit-wapper">
				<label class="lab">纬度：</label> <input type="text"
					name="restaurantBizBean.latitude" id="latitude" class="inputText"
					maxlength="30" style="width: 450px;" /> <label class="error">*&nbsp;&nbsp;<s:property
						value="%{errors['latitude'][0]}" /></label>
			</div>
			<!-- 餐厅类型必须为：宴席 start -->
			<div id="feast_div"
				style="<c:if test="${restaurantBizBean.restaurantType=='FEAST'}">display: block;</c:if><c:if test="${restaurantBizBean.restaurantType!='FEAST'}">display:none;</c:if> ">
				<div class="edit-wapper">
					<label class="lab">宴席价格：</label> <input type="text"
						name="restaurantBizBean.feastPrice" id="feastPrice"
						class="inputText" maxlength="30"
						value="${restaurantBizBean.feastPrice}" style="width: 450px" /> <label
						class="error">*&nbsp;&nbsp;<s:property
							value="%{errors['feastPrice'][0]}" /></label>
				</div>

				<div class="edit-wapper">
					<label class="lab">容纳桌席：</label> <input type="text"
						name="restaurantBizBean.accommodate" id="feastPrice"
						class="inputText" maxlength="30" style="width: 450px" /> <label
						class="error">*&nbsp;&nbsp;<s:property
							value="%{errors['accommodate'][0]}" /></label>
				</div>
			</div>
			<div id="restaurant_div"
				style="<c:if test="${restaurantBizBean.restaurantType!='FEAST'}">display: block;</c:if><c:if test="${restaurantBizBean.restaurantType=='FEAST'}">display:none;</c:if> ">
				<div class="edit-wapper">
					<label class="lab">人均消费：</label> <input type="text"
						name="restaurantBizBean.averageConsumption"
						id="averageConsumption" maxlength="100" class="inputText"
						style="width: 450px" /> <label class="error">*&nbsp;&nbsp;<s:property
							value="%{errors['averageConsumption'][0]}" /></label>
				</div>
			</div>
			<div class="edit-wapper">
				<label class="lab">订餐电话：</label> <input type="text"
					name="restaurantBizBean.TEL" id="TEL" maxlength="100"
					class="inputText" style="width: 450px" /> <label class="error">*&nbsp;&nbsp;<s:property
						value="%{errors['TEL'][0]}" /></label>
			</div>

			<div class="edit-wapper">
				<label class="lab">面积：</label> <input type="text"
					name="restaurantBizBean.useArea" id="useArea" maxlength="100"
					class="inputText" style="width: 450px" /> <label class="error">*&nbsp;&nbsp;<s:property
						value="%{errors['useArea'][0]}" /></label>
			</div>
			<div class="edit-wapper">
				<label class="lab">营业时间：</label> <input type="text"
					readonly="readonly" name="restaurantBizBean.businessHour"
					id="businessHour" maxlength="100" class="Wdate"
					style="width: 450px"
					onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" /> <label
					class="error">*&nbsp;&nbsp;<s:property
						value="%{errors['businessHour'][0]}" /></label>
			</div>

			<div class="edit-wapper">
				<label class="lab">负责人：</label> <input type="text"
					name="restaurantBizBean.superintendent" id="superintendent"
					maxlength="100" class="inputText" style="width: 450px" /> <label
					class="error">*&nbsp;&nbsp;<s:property
						value="%{errors['superintendent'][0]}" /></label>
			</div>

			<div class="edit-wapper">
				<label class="lab">相片：</label>
				<s:file name="files"></s:file>
				<input type="button" value="+" style="padding: 3px;" id="addFile">
			</div>
			<div id="file_add_div"></div>

			<div class="edit-wapper">
				<label class="lab">是否可以刷卡：</label>
				<s:radio list="#{'TRUE':'可以','FALSE':'不可以'}"
					name="restaurantBizBean.creditCard" />
				<label class="error">*&nbsp;&nbsp;<s:property
						value="%{errors['creditCard'][0]}" /></label>
			</div>

			<div class="edit-wapper">
				<label class="lab">WIFI：</label>
				<s:radio list="#{'TRUE':'有','FALSE':'没有'}"
					name="restaurantBizBean.WIFI" value="TRUE" />
				<label class="error">*&nbsp;&nbsp;<s:property
						value="%{errors['WIFI'][0]}" /></label>
			</div>

			<div class="edit-wapper">
				<label class="lab">餐厅简介：</label>
				<textarea name="restaurantBizBean.summary" id="summary" rows="5"
					maxlength="100" class="inputText" style="width: 450px"></textarea>
				<label class="error">*&nbsp;&nbsp;<s:property
						value="%{errors['summary'][0]}" /></label>
			</div>
			<div class="edit-wapper">
				<label class="lab">停车情况：</label>
				<textarea name="restaurantBizBean.parkingInfo" id="parkingInfo"
					rows="5" maxlength="100" class="inputText" style="width: 450px"></textarea>
				<label class="error">*&nbsp;&nbsp;<s:property
						value="%{errors['parkingInfo'][0]}" /></label>
			</div>
			<div class="edit-wapper">
				<label class="lab">公交信息：</label>
				<textarea name="restaurantBizBean.averageInfo" id="averageInfo"
					maxlength="100" rows="5" class="inputText" style="width: 450px"></textarea>
				<label class="error">*&nbsp;&nbsp;<s:property
						value="%{errors['averageInfo'][0]}" /></label>
			</div>

			<div class="btn-wapper">
				<s:submit cssClass="form-btn" value="保存" id="btnEnter" />
				<s:submit cssClass="form-btn" value="返回"
					action="restaurantAction!getRestaurants"></s:submit>
			</div>
		</s:form>

	</div>
	<div id="page-bottom">
		<b></b><i></i>
	</div>
</body>
<script type="text/javascript">
	$(function() {
		$('select[id="codes"]').change(function() {
			if ($(this).val() == 'RESTAURANT') {
				$("#feast_div").hide();
				$("#restaurant_div").show();
			} else {
				$("#feast_div").show();
				$("#restaurant_div").hide();
			}
		});
		$("#addFile")
				.click(
						function() {
							var html = '<div class="edit-wapper"><label class="lab">相片：</label><s:file name="files" ></s:file><input type="button" name="delFile" style="padding: 3px;" value="-"></div>';
							$("#file_add_div").append(html);
						});
		$("input[name='delFile']").live("click", function() {
			$(this).parent().remove();
		});
	});
</script>
</html>